package com.xzit.service;

import com.xzit.dao.TeamDao;
import com.xzit.dao.impl.TeamDaoImpl;
import com.xzit.model.Team;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Service
public class TeamService {
    @Autowired
    private TeamDao teamDao;
    private static final Logger logger = LoggerFactory.getLogger(com.xzit.TeamService.class);
    public void registerTeam(Team team) {
        teamDao.addTeam(team);
    }

    public boolean removeTeamByName(String name) {
        logger.info("根据名字删除球队: " + name);
        return teamDao.deleteTeamByName(name);
    }

    public void setTeamDao(TeamDaoImpl teamDao) {
        this.teamDao = teamDao;
    }
}
